<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>过滤器的使用</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>

</head>
<body>
    <script>
        new Vue({
            el:'app',
            data() {
                return {
                    str : 'to be a better man .'
                }
            },
        })
        console.log('创建一个过滤器');
        Vue.filter('upcase', function(value){
            if(!value) return '';
            value = value.toString();
            return value.charAt(0).toUpperCase() + value.splice(1);
        })

    </script>
</body>
</html>